import SwiftUI

@MainActor
@Observable final class AnimesViewModel {
    var animes: [Anime] = []
    
  
    @ObservationIgnored
    private let coordinator: AnimesCoordinator

    
    init( coordinator: AnimesCoordinator) {
        self.coordinator = coordinator
    }
    
    func fetch() async {
        animes = await UseCaseData.asyncGetAnimes()
    }
    
    
    func didSelect(anime: Anime) {
        coordinator.showDetail(for: anime)
    }

    
}
